import 'package:flutter/material.dart' hide MenuController;
import 'package:flutter_soundmagus/page/home/home_controller.dart';
import 'package:flutter_soundmagus/page/menu/menu_controller.dart';
import 'package:flutter_soundmagus/util/util.dart';
import 'package:get/get.dart';

class HomeView extends GetView<HomeController> {
  const HomeView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    Widget child = Stack(alignment: Alignment.center, children: [
      Image.asset(
        // 'home_bg'.img,
        'home_bg_2'.img,
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        fit: BoxFit.cover,
      ),
      Column(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          'home_brand'.uiimg,
          'home_model'.uiimg,
          // Stack(alignment: Alignment.center, children: [
          //   SizedBox(
          //     width: 366,
          //     height: 33,
          //     child: Stack(alignment: Alignment.center, children: [
          //       'home_btns'.uiimg,
          //       Row(
          //         children: [
          //           ...List.generate(5, (index) {
          //             Widget child = Container(
          //               width: 35,
          //               height: 33,
          //               // color: Colors.red,
          //             );
          //             if (index == 4) {
          //               child = Container(
          //                 height: 33,
          //                 width: 226,
          //                 // color: Colors.yellow,
          //               );
          //             }
          //             return GestureDetector(
          //               child: child,
          //               behavior: HitTestBehavior.translucent,
          //               onTap: () => controller.onLink(index),
          //             );
          //           }),
          //         ],
          //       ),
          //     ]),
          //   ),
          //   Align(
          //     alignment: Alignment.topRight,
          //     child: GestureDetectorExt(
          //       onTap: controller.onResetPwdClick,
          //       numberOfTap: 3,
          //       child: Container(
          //         color: Colors.black.withOpacity(0.3),
          //         padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 30),
          //         child: Text('version 1.1'),
          //       ),
          //     ),
          //   )
          // ]),
        ],
      ),
      Stack(alignment: Alignment.bottomCenter, children: [
        Positioned(
          left: 20,
          bottom: 0,
          width: 50,
          height: 50,
          child: GestureDetector(
            child: 'home_file'.uiimg,
            onTap: () {
              controller.onLink(0);
            },
          ),
        ),
        Positioned(
          bottom: 20,
          width: 30,
          height: 30,
          child: GestureDetector(
            child: 'home_pwd'.uiimg,
            onTap: () {
              controller.onResetPwdClick();
            },
          ),
        )
      ]),
    ]);
    return GestureDetector(
      child: child,
      onTap: () {
        Get.find<MenuController>().onMenu(Menu.summing);
      },
    );
  }
}
